Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 3 - Endpoints / Endpoints Reference
Constants and Data Types


The TUnitRequest Structure

You use the TUnitRequest structure to specify information about the data being sent with the OTSndURequest function (page 3-107) and the data being read with the OTRcvURequest function (page 3-110); you pass a pointer to this structure as a parameter to each of these functions.

The TUnitRequest structure is defined by the TUnitRequest data type.

struct TUnitRequest
{     TNetbuf     addr;
      TNetbuf     opt;
      TNetbuf     udata;
      OTSequence  sequence;
   };
   typedef struct TUnitRequest TUnitRequest;
Field Description
addr
A TNetbuf structure that contains information about an address.
In the req parameter to the OTSndURequest function, this field specifies the location and size of a buffer containing the address of the responder. You must allocate a buffer for the address and specify the address. You must set the addr.buf field to point to this buffer and set the addr.len field to the length of the address.
In the req parameter to the OTRcvURequest function, this field specifies the location and size of a buffer containing the address of the endpoint that made the request; the field is filled in by the OTRcvURequest function when it returns. You must allocate a buffer to hold address information and set the addr.buf field to point to it. You must also set the addr.maxlen field to the maximum size of the address.
opt
A TNetbuf structure that contains information about the options associated with this request.
In the req parameter to the OTSndURequest function, this field specifies the location and size of a buffer containing the options you want to negotiate. You must allocate a buffer that contains the option information and set the opt.buf field to point to it. You must set the opt.len field to the length of the option data or to 0 if you don't want to specify any options.
In the req parameter to the OTRcvURequest function, this field specifies the location and size of a buffer containing the association-related options specified by the requester. Otherwise, this buffer is empty. When the OTRcvURequest function returns, it places option information in this buffer. You must allocate a buffer to contain the option information and set the opt.buf field to point to this buffer. You must set the opt.maxlen field to the maximum size necessary to hold option information for the endpoint.
udata
A TNetbuf structure that contains information about the request data.
In the req parameter to the OTSndURequest function, this field specifies the location and size of a buffer containing the request data. You must allocate a buffer for the request data, initialize the udata.buf field to point to it, and set the udata.len field to the size of the request. The request size must not exceed the value for the etsdu field of the TEndpointInfo structure for the endpoint.
If you are sending data that is not stored contiguously, the udata.buf field is a pointer to an OTData structure that describes the first data fragment. In this case, you must set the udata.len field to the kNetbufDataIsOTData constant.
In the req parameter to the OTRcvURequest function, this field specifies the location and size of a buffer containing the request. You must allocate a buffer into which the OTRcvURequest function can place the request and set the udata.buf field to point to it. You must set the udata.maxlen field to the maximum size of the request data.
If you are doing a no-copy receive, the udata.buf field is a pointer to an OTBuffer pointer. In this case, you must set the udata.maxlen field to the constant kNetbufDataIsOTBufferStar.
sequence
A long that specifies the transaction ID for this transaction.
You set this field to any desired value when you send
the request.
When you read the request, this value is generated by the endpoint provider. You need to save this value and use it for the sequence field when sending a reply.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996